package cn.tedu.blog.server.controller.api;

import cn.tedu.blog.server.pojo.dto.PageDTO;
import cn.tedu.blog.server.pojo.vo.TagListItemVO;
import cn.tedu.blog.server.service.ITagService;
import cn.tedu.blog.server.utils.JsonPage;
import cn.tedu.blog.server.utils.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/tags")
@Api(tags = "前台标签查询模块" )
public class ApiTagController {
    @Autowired
    private ITagService tagService;

    @ApiOperation("最近标签")
    @ApiOperationSupport(order = 100)
    @GetMapping("/selectTagList")
    public JsonResult selectNewestTags(){
        log.debug("正在执行查询最新标签");
        List<TagListItemVO> list = tagService.selectTagList();
        return JsonResult.ok(list);
    }

}
